Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
interface System.​Numerics.​IBinaryNumber<​TSelf>
Assembly: System.Runtime
Implemented Interfaces
- IBitwiseOperators`3
- INumber`1 (Inherits: IComparableIComparable<​TSelf>IEquatable<​TSelf>IFormattableIParsable<​TSelf>ISpanFormattableISpanParsable<​TSelf>IAdditionOperators<​TSelf, TSelf, TSelf>IAdditiveIdentity<​TSelf, TSelf>IComparisonOperators<​TSelf, TSelf, bool>IEqualityOperators<​TSelf, TSelf, bool>IDecrementOperators<​TSelf>IDivisionOperators<​TSelf, TSelf, TSelf>IIncrementOperators<​TSelf>IModulusOperators<​TSelf, TSelf, TSelf>IMultiplicativeIdentity<​TSelf, TSelf>IMultiplyOperators<​TSelf, TSelf, TSelf>INumberBase<​TSelf>IUtf8SpanFormattableIUtf8SpanParsable<​TSelf>ISubtractionOperators<​TSelf, TSelf, TSelf>IUnaryNegationOperators<​TSelf, TSelf>IUnaryPlusOperators<​TSelf, TSelf>)
Defines a number that is represented in a base-2 format.
Properties
static
TSelf
AllBitsSet
Gets an instance of the binary type in which all bits are set.
Methods
static
bool
IsPow2​(TSelf value)
Determines if a value is a power of two.
Returns <see langword="true" /> if <paramref name="value" /> is a power of two; otherwise, <see langword="false" /> .
value
The value to be checked.
static
TSelf
Log2​(TSelf value)
Computes the log2 of a value.
Returns The log2 of <paramref name="value" /> .
value
The value whose log2 is to be computed.